/**
 * Formula.java
 * Created on  2015/4/1 12:31
 * 版本       修改时间         作者        修改内容
 * V1.0.1     2015/4/1     panzhuowen    初始版本
 */
package com.infitecs.eyas.expression.model;

import com.infitecs.eyas.common.ajax.DataTablesPage;
import com.infitecs.eyas.quality.model.Industry;
import org.hibernate.validator.constraints.NotBlank;

import java.util.List;

/**
 * 类的描述信息
 *
 * @author panzhuowen
 * @version 1.0.1
 */
public class Formula extends DataTablesPage {

    private Integer id;
    @NotBlank(message = "公式名称不能为空")
    private String formulaName;
    @NotBlank(message = "公式内容不能为空")
    private String formulaDescription;

    private String memo;
    private String paramer;
    private FormulaType formulaType;
    private Integer category;

    public Formula() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getFormulaName() {
        return formulaName;
    }

    public void setFormulaName(String formulaName) {
        this.formulaName = formulaName;
    }

    public String getFormulaDescription() {
        return formulaDescription;
    }

    public void setFormulaDescription(String formulaDescription) {
        this.formulaDescription = formulaDescription;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getParamer() {
        return paramer;
    }

    public void setParamer(String paramer) {
        this.paramer = paramer;
    }

    public FormulaType getFormulaType() {
        return formulaType;
    }

    public void setFormulaType(FormulaType formulaType) {
        this.formulaType = formulaType;
    }

    public Integer getCategory() {
        return category;
    }

    public void setCategory(Integer category) {
        this.category = category;
    }

    public char getCharOfFormulaType() {
        if (null == formulaType)
            return 'M';
        switch (formulaType.getId()) {
            case 1:
                return 'M';
            case 2:
                return 'Z';
            case 3:
                return 'H';
            case 4:
                return 'G';
            case 5:
                return 'D';
            case 6:
                return 'R';
        }
        return 'M';
    }
}
